﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Orderconsole
{
    class Program
    {
        static void Main(string[] args)
        {
            OrderService orderservice = new OrderService();

            //循环
            while (true)
            {//判断操作
                Console.WriteLine("请输入商品名称：");
                string order_ProductName = Console.ReadLine();
                Console.WriteLine("请输入客户名称：");
                string order_CustomerName = Console.ReadLine();
                Console.WriteLine("请输入产品名称：");
                int order_OrderNumber = Convert.ToInt32(Console.ReadLine());
                int op = 0;
                Console.WriteLine("请选择你要进行的操作：1.显示订单列表  2.增加订单 3.删除订单  4.修改订单5.查询订单");
                op = Convert.ToInt32(Console.ReadLine());
                Order order = new Order( order_ProductName,order_CustomerName,order_OrderNumber);

                switch (op)
                {
                    case 1:
                        orderservice.OrderDisplay();
                        break;
                    case 2:

                        orderservice.Addorder(order);
                        break;
                    case 3:
                        int k = Convert.ToInt32(Console.ReadLine());
                        orderservice.Deleteorder(k);
                        break;
                    case 4:
                        orderservice.AlterOrder();
                        break;
                    case 5:
                        string search = Console.ReadLine();
                        orderservice.SearchOrder(search);
                        break;

                    default:
                        Console.WriteLine("cuol ba ");
                        break;
                }



            }
            Console.ReadKey();
        
        }
    }
}